feat: add POST /api/sandbox endpoint#155
Conversation
* feat: add Google Drive and Google Docs to enabled toolkits - Add googledrive and googledocs to ENABLED_TOOLKITS array - Enables Tool Router access to Google Drive and Google Docs tools * docs: update JSDoc to mention all Google integrations
Create ephemeral sandbox environments using Vercel Sandbox SDK. - Add route handler with CORS and API key authentication - Add createSandbox function using @vercel/sandbox - Returns sandboxId, status, timeout, createdAt Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Braintrust eval reportCatalog Opportunity Analysis Evaluation (HEAD-1769198199)
Catalog Songs Count Evaluation (HEAD-1769198199)
First Week Album Sales Evaluation (HEAD-1769198199)
Memory & Storage Tools Evaluation (HEAD-1769198199)
Monthly Listeners Tracking Evaluation (HEAD-1769198199)
Search Web Tool Evaluation (HEAD-1769198199)
Social Scraping Evaluation (HEAD-1769198199)
Spotify Followers Evaluation (HEAD-1769198199)
Spotify Tools Evaluation (HEAD-1769198199)
TikTok Analytics Questions Evaluation (HEAD-1769198199)
|
The Vercel Sandbox SDK includes "snapshotting" as a valid status. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
| * @param request - The request object | ||
| * @returns A NextResponse with sandbox data or error | ||
| */ | ||
| export async function createSandboxPostHandler(request: NextRequest): Promise<NextResponse> { | ||
| const accountIdOrError = await getApiKeyAccountId(request); | ||
| if (accountIdOrError instanceof NextResponse) { | ||
| return accountIdOrError; | ||
| } |
| try { | ||
| const sandbox = await createSandbox(); | ||
|
|
||
| return NextResponse.json(sandbox, { status: 200, headers: getCorsHeaders() }); |
| return NextResponse.json(sandbox, { status: 200, headers: getCorsHeaders() }); | ||
| } catch (error) { | ||
| const message = error instanceof Error ? error.message : "Failed to create sandbox"; | ||
| return NextResponse.json({ error: message }, { status: 400, headers: getCorsHeaders() }); |
DRY - reference types from @vercel/sandbox instead of duplicating. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Summary
Files Added
app/api/sandbox/route.ts- Route handler with CORS and JSDoclib/sandbox/createSandbox.ts- Sandbox creation logic using Vercel SDKlib/sandbox/createSandboxPostHandler.ts- Request handler with API key authTest plan
🤖 Generated with Claude Code